package com.trdcore.zyzkt.controller;


import com.trdcore.zyzkt.resp.ResultData;
import com.trdcore.zyzkt.service.VideoVisitorService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 视频来访者记录表 前端控制器
 * </p>
 *
 * @author Luffy
 * @since 2024-03-18
 */
@Tag(name = "VideoVisitor管理")
@RestController
@RequestMapping(value="/admin/vod/videoVisitor")

public class VideoVisitorController {

    @Autowired
    private VideoVisitorService videoVisitorService;

    @Operation(summary = "显示统计数据",description = "显示统计数据")
    @GetMapping("findCount/{courseId}/{startDate}/{endDate}")
    public ResultData showChart(
            @Parameter(name = "开始时间") @PathVariable("courseId") Long courseId,
            @Parameter(name ="开始时间") @PathVariable("startDate") String startDate,
            @Parameter(name ="结束时间") @PathVariable("endDate") String endDate){

        Map<String, Object> map = videoVisitorService.findCount(courseId, startDate, endDate);
        return ResultData.success(map);
    }
}

